package com.clh.seckill.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author cailinhu
 * @Description TODO
 * @Date 2021-12-10 11:55
 * @Version 1.0
 */
@Configuration
public class RabbitMQConfig {
    public static  final  String ROUTING_KEY ="";
    public static final String QUEUE_NAME="";
    public static final String EXCHANGE_NAME="";

    @Bean
    public Queue queue(){
     return   new Queue(QUEUE_NAME,true);
    }
    @Bean
    public DirectExchange exchange(){
      return   new DirectExchange(EXCHANGE_NAME);
    }
    @Bean
    public Binding binding(){
       return BindingBuilder.bind(queue()).to(exchange()).with(ROUTING_KEY);
    }

}
